ApolloServerMutationAdapter
@h4ad/serverless-adapter > ApolloServerMutationAdapter
(class) ApolloServerMutationAdapter
The adapter that wraps another adapter to force a transformation of the event data as a mutation to Apollo Server be able to handle.
Signature:
export declare class ApolloServerMutationAdapter<TEvent, TContext, TResponse> implements AdapterContract<TEvent, TContext, TResponse>
Implements: AdapterContract <TEvent, TContext, TResponse>
(constructor)
The default constructor
Signature:
constructor(baseAdapter: AdapterContract<TEvent, TContext, TResponse>, options: ApolloServerMutationAdapterOptions);
Parameters
Parameter | Type | Description |
---|---|---|
baseAdapter | AdapterContract <TEvent, TContext, TResponse> | |
options |
(property) baseAdapter
Signature:
protected readonly baseAdapter: AdapterContract<TEvent, TContext, TResponse>;
(method) canHandle
Signature:
canHandle(event: unknown, context: TContext, log: ILogger): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
event | unknown | |
context | TContext | |
log |
Returns:
boolean
(method) getAdapterName
Signature:
getAdapterName(): string;
Returns:
string
(method) getRequest
Signature:
getRequest(event: TEvent, context: TContext, log: ILogger): AdapterRequest;
Parameters
Parameter | Type | Description |
---|---|---|
event | TEvent | |
context | TContext | |
log |
Returns:
(method) getResponse
Signature:
getResponse(props: GetResponseAdapterProps<TEvent>): TResponse;
Parameters
Parameter | Type | Description |
---|---|---|
props | GetResponseAdapterProps <TEvent> |
Returns:
TResponse
(method) onErrorWhileForwarding
Signature:
onErrorWhileForwarding(props: OnErrorProps<TEvent, TResponse>): void;
Parameters
Parameter | Type | Description |
---|---|---|
props | OnErrorProps <TEvent, TResponse> |
Returns:
void
(property) options
Signature:
protected readonly options: ApolloServerMutationAdapterOptions;